<template>
  <div class="bh-container">
    <table-list
      ref="table"
      @open-add="(e) => modal.openAdd(e)"
      @open-update="(e) => modal.openUpdate(e)"
    />
    <!-- 添加修改模态框 -->
    <bh-from ref="modal" @restart="() => table.restartCallback()" />
  </div>
</template>

<script setup lang="ts">
  import { ref, onBeforeMount } from 'vue';
  import TableList from './components/table.vue';
  import BhFrom from './components/bh-form.vue';

  const render = ref(false);
  const table = ref();
  const modal = ref();
  onBeforeMount(async () => {
    render.value = true;
  });
</script>
